<html>
<head>
{include file="header.tpl"}
</head>
<body>
<h1>SHONAN BBS 管理画面</h1>
<hr noshade size="1">
<div id="content">
  <div id="contentLeft">

    <h2>コメント編集画面</h2>
    <form action="./comment_edit_confirm.php"
          method="post"
          enctype="multipart/form-data">

    <div class="tblData">
    <table>
    <tr>
      <th>ニックネーム</th>
      <td>
      {*最初にこのページに来たのか、戻るボタンで来たのかを分岐*}
{if $smarty.session.tmpnickname != "" || $error_nickname_yn == "y"}
    <input type="text" name="nickname" size"20"
           value="{$smarty.session.tmpnickname|escape}">
{else}
    <input type="text" name="nickname" size="20"
           value="{$comment.nickname|escape}">
{/if}
{if $error_nickname_yn == "y"}
<font color="red">ニックネームが空です</font>
{/if}
    </td>
  </tr>
  <tr>
    <th>内容</th>
  <td>
  <textarea name="content" cols="60" rows="10">{if $smarty.session.tmpcontent != "" || $error_content_yn == "y"}{$smarty.session.tmpcontent}{else}{$comment.content}{/if}</textarea>
{if $error_nickname_yn == "y"}
<font color="red">コンテントが空です</font>
{/if}
    </td>
  </tr>
      <tr>
      <th>カテゴリ</th>
      <td>
<select name="category_id">
{foreach from=$categorys item=category key=k}
<option value="{$k}"
{if $smarty.session.tmpcategory_id != ""}
  {if $smarty.session.tmpcategory_id==$k}selected="selected"{/if}
{else}
  {if $comment.category_id ==$k}selected="selected"{/if}
{/if}
>
{$category}
</option>
{/foreach}
</select>
    </td>
  </tr>
    <tr>
      <th>URL</th>
      <td>
      {*最初にこのページに来たのか、戻るボタンで来たのかを分岐*}
{if $smarty.session.tmpnickname != ""}
    <input type="text" name="url" size"60"
           value="{$smarty.session.tmpurl|escape}">
{else}
    <input type="text" name="url" size="60"
           value="{$comment.url|escape}">
{/if}
    </td>
  </tr>  <tr>
  <th>画像</th>
  <td>
  {**}
{if $smarty.session.tmpphoto !=""}
    <img src="{$smarty.session.tmpphoto}" width="100"><br>
{elseif $comment.photo !=""}
    <img src="../tmp/{$tmpname}" width="100"><br>
    <input type="hidden" name="tmpname" value="{$tmpname}">
{/if}
    <input type="file" name="photo">
{if $error_photo_yn == "y"}
<font color="red">画像ファイルではありません</font>
{/if}
    </td>
  </tr>
  </table>
  </div>
  <input type="hidden" name="comment_edit_input_id"
         value="{$smarty.session.comment_edit_input_id}">
  <input type="hidden" name="id" value="{$comment.id}">
  <input type="submit" name="submit" value="確認する">
  </form>

  </div>
  <div id="contentRight">
{include file="menu.tpl"}
  </div>
</div>
<div class="clr"></div>
{include file="footer.tpl"}
</body>
</html>